package com.ele.Servlet;

import com.ele.Pojo.PageResult;
import com.ele.Pojo.Shop;
import com.ele.Service.ShopService;
import com.ele.Service.impl.ShopServiceImpl;
import com.google.gson.Gson;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/shopAuditList")
public class ShopAuditListServlet extends HttpServlet {
    //创建service对像
    private ShopService shopService= new ShopServiceImpl();

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String currentPage = req.getParameter("currentPage");
        String pageSize = req.getParameter("pageSize");
        String shopName = req.getParameter("shopName");
        String status = req.getParameter("status");

        PageResult<List<Shop>> list = this.shopService.shopAuditList(currentPage,pageSize,shopName,status);

        String json =new Gson().toJson(list);
        resp.setContentType("application/json;charset=utf-8");
        resp.getWriter().write(json);


    }


}
